//导入vue-router
import { createRouter, createWebHistory } from 'vue-router'
//导入组件
import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'

import LastFourVue from '@/views/announcement/LastFour.vue'
import AnnouncementAllVue from '@/views/announcement/AnnouncementAll.vue'
import ApplicationVue from '@/views/item/Application.vue'
import BeginPageVue from '@/views/item/BeginPage.vue'
import MidPageVue from '@/views/item/MidPage.vue'
import EndPageVue from '@/views/item/EndPage.vue'
import EvolveVue from '@/views/item/Evolve.vue'
import DetailVue from '@/views/announcement/Detail.vue'
import ItemDetailsVue from '@/views/item/ItemDetails.vue'
import FinishAccessoryVue from '@/views/item/FinishAccessory.vue'
import ChangeMemberVue from '@/views/item/ChangeMember.vue'
import ErrorMsgVue from '@/views/item/ErrorMsg.vue'
import UpLoadVue from '@/views/item/UpLoad.vue'
import ExtensionVue from '@/views/item/Extension.vue'
import UserInfoVue from '@/views/user/UserInfo.vue'
import UserResetPasswordVue from '@/views/user/UserResetPassword.vue'
//定义路由关系
const routes = [
   { path: '/login', component: LoginVue  },
   { path: '/', component: LayoutVue
   ,redirect: '/announcement/getLatestNotice'
   ,children:[
    {path:'/announcement/getLatestNotice',component: LastFourVue},
    {path:'/announcement/page',component: AnnouncementAllVue},
    {path:'/project',component: ApplicationVue},
    {path:'/project/establishment',component: BeginPageVue},
    {path:'/project/mid_term',component: MidPageVue},
    {path:'/project/closing_item',component: EndPageVue},
    {path:'/project/logCount',component: EvolveVue},
    {path:'/details',component: DetailVue},
    {path:'/item/details',component:ItemDetailsVue},
    {path:'/finish',component: FinishAccessoryVue},
    {path:'/changeMember',component: ChangeMemberVue},
    {path:"/error",component:ErrorMsgVue},
    {path:"/upload/item",component:UpLoadVue},
    {path:'/extension',component:ExtensionVue},
    { path: '/user/info', component: UserInfoVue },
    { path: '/user/resetPassword', component: UserResetPasswordVue }
   ] 
  }
 
 
]
//创建路由器
  const router = createRouter({
  history: createWebHistory(),
  routes: routes
});
export default router